<!-- Top Navigation Bar -->

{% load app_tags %}
{% load i18n %}

{% get_current_language as LANGUAGE_CODE %}

<nav class="navbar navbar-expand-lg navbar-dark fixed-top">
    <div class="container-fluid">
        <a class="navbar-brand" href="/{% if LANGUAGE_CODE != 'zh' %}en{% else %}zh{% endif %}"><img src="/static/images/logo.png"/></a>

        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
                aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>

        <div class="collapse navbar-collapse" id="navbarSupportedContent">

            <form action="{% url 'search' %}" class="form-inline">
                <input class="form-control mr-sm-2 typeahead" type="search" name="q" placeholder="Search PaddlePaddle.org"  autocomplete="off" />
                <input type="hidden" name="version" value="{{ CURRENT_DOCS_VERSION }}"/>
                <input type="hidden" name="language" value="{{ lang }}"/>
            </form>
            <ul class="navbar-nav ml-auto">
                <li class="nav-item{% if '/documentation' in request.path %} active{% endif %}">
                    <a class="nav-link" href="/documentation/{% if LANGUAGE_CODE != 'zh' %}en{% else %}zh{% endif %}"{% if settings.ENV != 'production' and settings.ENV != 'staging' %} onclick="return showFullpageSpinnerForContentId('documentation');"{% endif %}>{% trans "Documentation" %}<span class="sr-only">(current)</span></a>
                </li>
                {% if LANGUAGE_CODE == 'zh' %}

                <li class="nav-item">
                    <a class="nav-link" href="/documentation/docs/zh/{{ default_docs_version }}/user_guides/models/index_cn.html">模型库</a>
                </li>
                {% endif %}
                <li>
                    <a class="nav-link" href="/about_{% if LANGUAGE_CODE != 'zh' %}en{% else %}cn{% endif %}.html">{% trans "About" %}</a>
                </li>
            </ul>
            <ul class="navbar-nav">
                <!-- Contact us for Chinese version only -->
                {% if LANGUAGE_CODE == 'zh' %}
                <li>
                    <a class="nav-link" data-toggle="modal" data-target="#feedbackModal">联系我们</a>
                </li>
                <li class="dropdown">
                    <a class="nav-link dropdown-toggle" data-toggle="dropdown">企业应用</a>
                    <ul class="dropdown-menu sub-menu">
                        <li>
                            <a href="{% url 'suite' %}" class="py-3 px-4">
                                <div class="title">PaddlePaddle Suite</div>
                                <div class="sub-title">面向工业应用的深度学习全功能套件</div>
                            </a>
                        </li>
                        <li>
                            <a href="http://ai.baidu.com/easydl/" target="_blank" class="py-3 px-4">
                                <div class="title">Easy DL</div>
                                <div class="sub-title">零算法基础训练业务定制模型</div>
                            </a>
                        </li>
                        <li>
                            <a href="http://ai.baidu.com/paddlepaddle/caselist" target="_blank" class="py-3 px-4">
                                <div class="title">应用案例</div>
                                <div class="sub-title">通过PaddlePaddle实现的工业案例</div>
                            </a>
                        </li>

                    </ul>
                </li>
                {% endif %}
            </ul>
            <ul class="navbar-nav">
                <li>
                    <a class="nav-link" href="{{ community_link }}" target="_blank">{% trans "Community" %}</a>
                </li>
                <li><a class="nav-link" href="https://github.com/PaddlePaddle/Paddle" target="_blank">
                    GitHub
                </a></li>
                <li>
                    <a class="nav-link" href="{{ lang_def.link }}">{{ lang_def.label}}</a>
                </li>
                {% if settings.ENV != 'production' and settings.ENV != 'staging' %}
                    {% if content_id %}
                    <li>
                        <a class="nav-link primary" href="{% url 'reload_docs' %}" onclick="return showFullpageSpinnerForContentId('{{ content_id }}');"><i class="fas fa-sync"></i>{% trans "Refresh Content" %}</a>
                    </li>
                    {% endif %}
                {% endif %}
            </ul>
        </div>
    </div>
</nav>
